#include <functional>
#include <queue>
#include <vector>
class Solution {
public:
    vector<int> GetLeastNumbers_Solution(vector<int>& input, int k) {
        if(input.size() == 0||k == 0)
        {
            return vector<int>();
        }
       priority_queue<int,vector<int>> minque;
       for(int i = 0;i<k;i++)
       {
            minque.push(input[i]);
       }
       for(int i = k;i<input.size();i++)
       {
            if(minque.top()>input[i])
            {
                minque.pop();
                minque.push(input[i]);
            }
       }
       vector<int> ret;
       while(!minque.empty())
       {
            ret.push_back(minque.top());
            minque.pop();
       }
       return ret;
    }
};